package org.ttitfly.ttcore.json.menu;

import org.apache.commons.lang.builder.HashCodeBuilder;

public class BaseMenu {

	private String id;
	
	/**
	 * 该属性仅用作排序
	 */
	private Integer orderNum;
	
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
	
	
	public Integer getOrderNum() {
		return orderNum;
	}

	public void setOrderNum(Integer orderNum) {
		this.orderNum = orderNum;
	}

	@Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        final BaseMenu other = (BaseMenu) obj;

        String id1 = getId();
        String id2 = other.getId();
        if (id1 == null) {
            return false;
        } else {
            return id1.equalsIgnoreCase(id2);
        }
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder().append(this.getId()).toHashCode();
    }
}
